package pers.jphoebe.quartz.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Created by 蒋时华 on 2017/11/2.
 */
@ApiModel(value = "GsiGoldPrice", description = "投资金对象")
public class GsiGoldPrice implements Serializable {

    /**
     * 类型：Ag(T+D)、Au(T+D)
     */
    @ApiModelProperty(value = "类型")
    private String type;
    /**
     * 零售价
     */
    @ApiModelProperty(value = "零售价")
    private BigDecimal retailPriceTotal;
    /**
     * 供货价
     */
    @ApiModelProperty(value = "供货价")
    private BigDecimal supplyPriceTotal;
    /**
     * 零售价/g
     */
    @ApiModelProperty(value = "零售价/g")
    private BigDecimal retailPriceByG;
    /**
     * 供货价/g
     */
    @ApiModelProperty(value = "供货价/g")
    private BigDecimal supplyPriceByG;
    /**
     * 价/g
     */
    @ApiModelProperty(value = "价/g")
    private BigDecimal priceByG;
    /**
     * 数量/重量：请求参数，默认为0   ----金、银
     */
    @ApiModelProperty(value = "克重",required = true)
    private Integer quantity;
    /**
     * 银行中收价(零售利润价格-供货利润价格)
     * @return
     */
    @ApiModelProperty(value = "银行中收价/g")
    private BigDecimal backIncomePriceByG;
    /**
     * 银行中收
     * @return
     */
    @ApiModelProperty(value = "银行中收")
    private BigDecimal backIncome;
    /**
     * 供货利润价格：请求参数，默认为0   ----金
     */
    @ApiModelProperty(value = "供货利润价格")
    private BigDecimal supplyProfitPrice;
    /**
     * 零售利润价格：请求参数，默认为0   ----银
     */
    @ApiModelProperty(value = "零售利润价格",required = true)
    private BigDecimal retailProfitPrice;


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getQuantity() {
        return quantity==null?0:quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public BigDecimal getRetailPriceTotal() {
        return retailPriceTotal;
    }

    public void setRetailPriceTotal(BigDecimal retailPriceTotal) {
        this.retailPriceTotal = retailPriceTotal;
    }

    public BigDecimal getSupplyPriceTotal() {
        return supplyPriceTotal;
    }

    public void setSupplyPriceTotal(BigDecimal supplyPriceTotal) {
        this.supplyPriceTotal = supplyPriceTotal;
    }

    public BigDecimal getPriceByG() {
        return priceByG;
    }

    public void setPriceByG(BigDecimal priceByG) {
        this.priceByG = priceByG;
    }

    public BigDecimal getBackIncomePriceByG() {
        return backIncomePriceByG==null?(this.getRetailProfitPrice().subtract(this.getSupplyProfitPrice())):backIncomePriceByG;
    }

    public void setBackIncomePriceByG(BigDecimal backIncomePriceByG) {
        this.backIncomePriceByG = backIncomePriceByG;
    }


    public BigDecimal getBackIncome() {
        return backIncome;
    }

    public void setBackIncome(BigDecimal backIncome) {
        this.backIncome = backIncome;
    }

    public BigDecimal getSupplyProfitPrice() {
        return supplyProfitPrice==null?new BigDecimal("0"):supplyProfitPrice;
    }

    public void setSupplyProfitPrice(BigDecimal supplyProfitPrice) {
        this.supplyProfitPrice = supplyProfitPrice;
    }

    public BigDecimal getRetailProfitPrice() {
        return retailProfitPrice==null?new BigDecimal("0"):retailProfitPrice;
    }

    public void setRetailProfitPrice(BigDecimal retailProfitPrice) {
        this.retailProfitPrice = retailProfitPrice;
    }

    public BigDecimal getRetailPriceByG() {
        return retailPriceByG==null?(this.getPriceByG().add(this.getRetailProfitPrice())):retailPriceByG;
    }

    public void setRetailPriceByG(BigDecimal retailPriceByG) {
        this.retailPriceByG = retailPriceByG;
    }

    public BigDecimal getSupplyPriceByG() {
        return supplyPriceByG==null?(this.getPriceByG().add(this.getSupplyProfitPrice())):supplyPriceByG;
    }

    public void setSupplyPriceByG(BigDecimal supplyPriceByG) {
        this.supplyPriceByG = supplyPriceByG;
    }
}
